#!/bin/bash
# 安装系统依赖
sudo apt-get install -y \
    python3-pyqt5 \
    libnotify-bin \
    xdg-utils \
    python3-dbus \
    python3-pip

# 安装Python依赖
pip3 install notify2 pyinstaller

# 创建桌面快捷方式
cat > ~/.local/share/applications/deskmanager.desktop << EOF
[Desktop Entry]
Name=DeskManager
Comment=Desktop Folder Manager
Exec=deskmanager
Icon=${PWD}/resources/tray_icon.png
Terminal=false
Type=Application
Categories=Utility;
EOF

# 打包程序
pyinstaller --onefile --windowed \
    --add-data "resources/*:resources" \
    --name deskmanager \
    main.py

echo "安装完成，程序位于: ./dist/deskmanager"